# Dockerfile

#######################################################
##docker base image selection part：
# select AnolisOS tag
# The available selection:  8.6-x86_64/8.6-aarch64/7.9-x86_64/7.9-aarch64
# sample：FROM registry.hub.docker.com/openanolis/anolisos:8.6-x86_64
FROM registry.hub.docker.com/openanolis/anolisos:8.6-x86_64
#####################################################

ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); rm -f /lib/systemd/system/multi-user.target.wants/*;rm -f /etc/systemd/system/*.wants/*;rm -f /lib/systemd/system/local-fs.target.wants/*; rm -f /lib/systemd/system/sockets.target.wants/*udev*; rm -f /lib/systemd/system/sockets.target.wants/*initctl*; rm -f /lib/systemd/system/basic.target.wants/*;rm -f /lib/systemd/system/anaconda.target.wants/*;
#####################################################
########## customize configuration block ###########
## pre-install part:
# write commands here
# sample: touch /etc/anolis-preinstall.log
#
####################################################
## package installation part
# if the packages that will be installed were supplied by the official repo.you can install them in this way:
# sample: yum install mariadb-server -y
# if the packages were supplied by some other repos,please install them in this way:
# rpm --import <gpgkey>
# yum --repofrompath=<repo_name>,<repo_url> install -y <pack>
# sample: rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS;# yum --repofrompath=AppStream-custom,https://mirrors.openanolis.cn/anolis/8.6/AppStream/x86_64/os/ install -y redis;#

RUN yum --nogpgcheck --disablerepo=AppStream --repofrompath=ShangMi,https://mirrors.openanolis.cn/anolis/8.6/ShangMi/x86_64/os -y install qatengine asynch_mode_nginx
#
###################################################
## post-install part
# write command here
# sample: touch /etc/anolis-after-install.log;
#
####################################################
VOLUME [ "/sys/fs/cgroup" ]

EXPOSE 80
EXPOSE 443

STOPSIGNAL SIGQUIT

CMD ["nginx", "-g", "daemon off;"]
